<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{#<div class="logo">#}
{#<form action="/upload" method="post" enctype="multipart/form-data">#}
    <input type="file" id="file" name="file">
    <button type="submit" id="botton">上传</button>
{#</form>#}
{#</div>#}
</body>
<script src="https://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js"></script>
<script type="text/javascript">
    $(function (){
        $("#botton").click(function (){
            var fileObj = document.getElementById("file").files[0];
            if (typeof (fileObj) == "undefined" || fileObj.size == 0){
                alert("请上传文件")
                return;
            }
            var fromFile = new FormData();
            fromFile.append("action", "UploadVMKImagePath")
            fromFile.append("file", fileObj)

            $.ajax({
                url: "/upload",
                data: fromFile,
                type: "Post",
                dataType: "json",
                cache: false,
                processData: false,
                contentType: false,
                success: function (result) {
                    alert("上传成功");
                },
            })
        })
    })
</script>
</html>